package cn.cque.entity;

import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: XWC
 * @ClassName: InfoResult
 * @Date: 2020/9/24
 * @Time: 9:52
 * @Description:返回信息的类型，类似ResponseCode
 */
@Data
public class InfoResult {
    private Integer code;
    private String info;

    public InfoResult(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public InfoResult() {
    }

    public InfoResult(Integer code) {
        this.code = code;
    }

    public static InfoResult ERROR(String info){
        InfoResult infoResult=new InfoResult(0,info);
        return infoResult;
    }

    public static InfoResult SUCCESS(){
        InfoResult infoResult=new InfoResult(1);
        return infoResult;
    }
    public static InfoResult SUCCESS(String info){
        InfoResult infoResult=new InfoResult(1,info);
        return infoResult;
    }
}